  <%@page import="java.util.Enumeration"%>
<%@page import="java.util.Hashtable"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Iterator"%>
<%@page import="eBrain.beans.Category"%>
  <jsp:useBean id="dataManager" scope="application"
  class="eBrain.model.DataManager"/>
<% String base = (String)application.getAttribute("base"); %>
<div class="menu">
<% 
    ArrayList catlist = new ArrayList<Category>();
	catlist = dataManager.getCategoryLevel(1, 0);
	Iterator it = catlist.iterator();
    %>
    <h3 class="headerbar"> Categories </h3>
    <ul>
    <% 
    while (it.hasNext()) {
    	Category c = (Category)it.next();
      	out.println("<li><a href=" + base + "?action=selectCategory&id="
        + c.getCategoryId() + ">" + c.getName() + "</a></li>"
        );
      }
 	 %>
  	</ul>
 </div>